package com.starleague.hexagonal;

import java.util.Map;

import com.starleague.common.AbstractHasInfoProperties;

public abstract class AbstractHex
        extends AbstractHasInfoProperties
        implements IHex
{
    private AbstractHexGrid hexGrid;

    private AbstractHexCoordinate hexCoordinate;

    protected AbstractHex(AbstractHexGrid hexGrid,
                          AbstractHexCoordinate hexCoordinate)
    {
        this.hexGrid = hexGrid;
        this.hexCoordinate = hexCoordinate;
    }

    protected AbstractHex()
    {
        //
    }

    @Override
    public AbstractHexGrid getHexGrid()
    {
        return this.hexGrid;
    }

    protected void setHexGrid(AbstractHexGrid hexGrid)
    {
        this.hexGrid = hexGrid;
    }

    @Override
    public AbstractHexCoordinate getHexCoordinate()
    {
        return this.hexCoordinate;
    }

    protected void setHexCoordinate(AbstractHexCoordinate hexCoordinate)
    {
        this.hexCoordinate = hexCoordinate;
    }

    @Override
    public Map<String, Object> infoProperties()
    {
        Map<String, Object> infoPropertyMap = super.infoProperties();
        infoPropertyMap.put("hexCoordinate", this.hexCoordinate);
        return infoPropertyMap;
    }
}
